import { defineStore } from "pinia";

const useFlowStore = defineStore({
  id: "flow",
  state: () => ({
    nodeMap: new Map(),
    isEdit: null,
    selectedNode: {},
    selectFormItem: null,
    design: {
      formConfig: {},
      formItems: []
    },
    equipmentList: []
  }),
  actions: {
    setSelectedNode(value) {
      this.selectedNode = value;
    },
    loadForm(value) {
      this.design = value;
    },
    setIsEdit(value) {
      this.isEdit = value;
    }
  }
});

export default useFlowStore;
